package org.csu.onlineedubackend.service;

import org.csu.onlineedubackend.entity.*;
import org.csu.onlineedubackend.entity.ChatMessage;

import java.util.List;
import java.util.Map;

public interface ChatService {
    
    // 创建私聊会话
    Conversation createPrivateConversation(Integer userId1, Integer userId2);
    
    // 创建群聊会话
    Conversation createGroupConversation(String groupName, Integer ownerId, List<Integer> memberIds);
    
    // 获取用户的所有会话
    List<Map<String, Object>> getUserConversations(Integer userId);
    
    // 获取会话的消息历史
    List<ChatMessage> getConversationMessages(Long conversationId, Integer userId, int page, int size);
    
    // 发送消息
    ChatMessage sendMessage(ChatMessage chatMessage);
    
    // 标记消息为已读
    void markAsRead(Long conversationId, Integer userId);
    
    // 获取会话参与者
    List<User> getConversationParticipants(Long conversationId);
    
    // 添加用户到群聊
    void addUserToGroup(Long groupId, Integer userId);
    
    // 从群聊中移除用户
    void removeUserFromGroup(Long groupId, Integer userId);
    
    // 获取用户未读消息数
    Map<Long, Integer> getUnreadMessageCounts(Integer userId);
    
    // 删除会话
    boolean deleteConversation(Long conversationId, Integer userId);
} 